<template>
  <div class="adminfpgl">
    <admin_top></admin_top>
    <div style="padding: 0 20px;">
      <div style="padding:20px 0 " >
          <el-input style="width:180px"  v-model="name" placeholder="请输入店铺名称"></el-input>
          <el-button @click="getlist"  type="danger">搜索</el-button>
      </div>
      
      
  
      <el-table :data="tableData" style="text-align: center;" align="center" border :loading="loading">
        <el-table-column label="店铺ID">
          <template slot-scope="scope">
            <span>{{ scope.row.user_id }}</span>
          </template>
        </el-table-column>

        <el-table-column label="商户店铺名">
          <template slot-scope="scope">
            <span>{{ name }}</span>
          </template>
        </el-table-column>

        <el-table-column label="消费记录">
          <template slot-scope="scope">
            <el-button type="text" @click="go(scope.row.user_id)">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>

  </div>
</template>

<script>
  import admin_top from './top.vue';
  import axios from 'axios'
  export default {
    components: {
      admin_top
    },
    name: 'adminfpgl',
    data() {
      return {
        name:"",
        tableData: "",
        loading: true,
        
      }
    },
    watch: {

    },
    computed: {

    },
    created() {

    },
    methods: {
      
      getlist: function() {
      	axios.get(`/api/plan-market/admin/shop/info?name=${this.name}`)
      		.then(response => {
      			if (response.data.msg.code == 0) {
      				this.tableData = [response.data.data]
      			} else {
      				this.$message.error(response.data.msg.info);
      			}
      		});
      },

      go: function(id) {
        this.$router.push({
          path:'/adminfpgl/adminfpgl2',
          query:{
            id:id
          }
        })
      },

    },

  }
</script>

<style scoped>
  .adminfpgl {
    background: #EAEAEA;
    min-height: 100vh;
    padding: 0px;
  }
</style>
